package com.zhanghe.study.design_pattern.visitor_pattern;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zh
 * @date 2022/10/24 12:03
 */
public class ObjectStructure {

    private List<Element> list = new ArrayList<>();

    public void handleRequest(Visitor visitor){
        for(Element element : list){
            element.accept(visitor);
        }
    }

    public void addElement(Element ele){
        list.add(ele);
    }
}
